<template>
	<view>
		<view class="uinput">
			<u--input  placeholder="请输入手机号" class="uinput" border="surround" v-model="phone"></u--input>
		</view>

		<view class="uinput" >
			<u--input password placeholder="请输入密码" class="uinput" border="surround" v-model="newPassword"></u--input>
		</view>
		<view class="uinput" >
			<u-input  placeholder="请输入验证码" class="uinput" border="surround" v-model="code">
				
			</u-input>
		</view>
		<view @click="tologin" class="dl" >
			<text>修 改</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code:'',
				phone:'',
				newPassword:''
			};
		},
		methods:{
			tologin(){
				this.$api.post('/verification/resetPassword',{
					phone:this.phone,
					newPassword:this.newPassword,
					code:this.code
				}).then(res=>{
					this.$toast('修改成功')
					setTimeout(()=>{
						uni.redirectTo({
							url:'/pages/login/login'
						})
					},1000)
				})
				
			},
		}
	}
</script>

<style lang="scss">
	.uinput {
		width: 686rpx;
		margin: 30rpx auto;
		box-sizing: border-box;
	}

	.dl {
		background-color: $main-color;
		width: 686rpx;
		padding: 20rpx;
		border-radius: 20rpx;
		color: #fff;
		text-align: center;
		margin: 100rpx auto;
		box-sizing: border-box;
	}
</style>